#include<bits/stdc++.h>
const double eps = 1e-9;
using namespace std;
int main() {
    int arr[5];
    for (int i = 0, a, b; i<5; ++i) {
        scanf("%d.%d", &a, &b);
        arr[i] = 100*a+b;
    }
    sort(arr, arr+4);
    if (arr[1]+arr[2]+arr[3] <= arr[4]*3) printf("infinite\n");
    else if (arr[0]+arr[1]+arr[2] > arr[4]*3) printf("impossible\n");
    else {
        int tmp = arr[4]*3-arr[1]-arr[2];
        double ans = tmp/100.0+eps;
        printf("%.2f\n", ans);
    }
    return 0;
}
